package com.ganmiao.enums;


import lombok.Getter;

/**
 * @version: java version 1.8
 * @Author: fuHoi
 * @description:
 * @date: 2024-04-02 11:07
 */

@Getter
public enum EligibleTypeEnums {
   /* 资格类型：平台资格
     */
    PLATFORM_QUALIFICATION("1", "平台资格"),
    /**
     * 资格类型：独立标资格
     */
    INDEPENDENT_BID_QUALIFICATION("2", "独立标资格");

    private final String code;
    private final String name;

    EligibleTypeEnums(String code, String name) {
        this.code = code;
        this.name = name;
    }

    // 根据code获取枚举实例
    public static EligibleTypeEnums getByCode(String code) {
        for (EligibleTypeEnums type : values()) {
            if (type.getCode().equals(code)) {
                return type;
            }
        }
        throw new IllegalArgumentException("Invalid qualification type code: " + code);
    }
}
